<template>
    <div>
        <h1>会员等级列表</h1>
        <table class="table table-bordered">
            <tbody>
                <tr class="bg-success">
                    <td>id</td>
                    <td>等级名称</td>
                    <td>累计消费金额</td>
                    <td>操作</td>
                </tr>
                <tr v-for="item in list.a">
                    <td>{{ item.Id }}</td>
                    <td>{{ item.LevelName }}</td>
                    <td>{{ item.Moeny }}</td>
                    <td>
                        <input type="button" value="修改" class="btn btn-success" @click="" />
                        <input type="button" value="删除" class="btn btn-danger" @click="" />
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref, reactive, onMounted } from 'vue'
import { useRouter } from 'vue-router'

//声明变量存储后端返回数据
let list: any = reactive({
    a: [],
})
// let list:any=ref([]);
//onMounted 生命周期函数 相当于文档就行函数
onMounted(() => {
    getList();
});
const getList = () => {
    axios({
        url: '/api/Menber/GetMenberLevelList',
        method: 'get',
    })
        .then(res => {
            console.log(res);
            // list.value=res.data
            list.a = res.data;
        })
};

</script>

<style scoped></style>